class Solution(object):
    def subsets(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        out = []
        already_list = []
        max_index = len(nums) - 1
        now_index = -1

        def add_element(already_list, now_index):
            out.append(already_list)
            next_index = now_index + 1
            if next_index <= max_index:
                for i in range(next_index, max_index + 1):
                    new_already_list = already_list.copy()
                    new_already_list.append(nums[i])
                    add_element(new_already_list, i)

        add_element(already_list, now_index)
        return out


data = Solution()
nums = [0]
print(data.subsets(nums))
